<!DOCTYPE html>

<html lang="en" data-content_root="./">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>pyBaf2Sql package &#8212; pyBaf2Sql 0.2.2 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
    <link rel="stylesheet" type="text/css" href="_static/basic.css?v=c058f7c8" />
    <link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=27fed22d" />
    <script src="_static/documentation_options.js?v=000c92bf"></script>
    <script src="_static/doctools.js?v=9a2dae69"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <section id="pybaf2sql-package">
<h1>pyBaf2Sql package<a class="headerlink" href="#pybaf2sql-package" title="Link to this heading">¶</a></h1>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading">¶</a></h2>
</section>
<section id="module-pyBaf2Sql.baf">
<span id="pybaf2sql-baf-module"></span><h2>pyBaf2Sql.baf module<a class="headerlink" href="#module-pyBaf2Sql.baf" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.close_storage">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">close_storage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conn</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.close_storage" title="Link to this definition">¶</a></dt>
<dd><p>Close BAF dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for BAF dataset initialized using pyBaf2Sql.baf.open_storage().</p></li>
<li><p><strong>conn</strong> (<em>sqlite3.Connection</em>) – SQL database connection to analysis.sqlite.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of the handle and connection.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.extract_baf_spectrum">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">extract_baf_spectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.extract_baf_spectrum" title="Link to this definition">¶</a></dt>
<dd><p>Extract spectrum from BAF data with m/z and intensity arrays. Spectrum can either be centroid or profile mode. If
“raw” mode is chosen, centroid mode will automatically be used.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf_data</strong> (<em>timsconvert.classes.TimsconvertBafData</em>) – baf_data object containing metadata from analysis.sqlite database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – Frame to extract spectrum from.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Mode command line parameter, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Tuple of mz_array (np.array) and intensity_array (np.array).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple[numpy.array]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.get_num_elements">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">get_num_elements</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">identity</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.get_num_elements" title="Link to this definition">¶</a></dt>
<dd><p>Get the number of elements stored in an array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for BAF dataset initialized using pyBaf2Sql.baf.open_storage().</p></li>
<li><p><strong>identity</strong> (<em>str</em><em> | </em><em>int</em>) – ID of the desired array.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Number of elements in the array of the specified ID.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.get_sqlite_cache_filename">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">get_sqlite_cache_filename</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.get_sqlite_cache_filename" title="Link to this definition">¶</a></dt>
<dd><p>Find the filename of the SQLite cache corresponding to the specified BAF file. The SQLite cache will be created
with the filename “analysis.sqlite” if it does not exist yet.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to Bruker .d directory containing analysis.baf and analysis.sqlite.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>SQLite filename.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.get_sqlite_cache_filename_v2">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">get_sqlite_cache_filename_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">all_variables</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.get_sqlite_cache_filename_v2" title="Link to this definition">¶</a></dt>
<dd><p>Find the filename of the SQLite cache corresponding to the specified BAF file. The SQLite cache will be created
with the filename “analysis.sqlite” if it does not exist yet with the option to include all supported variables.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to Bruker .d directory containing analysis.baf and analysis.sqlite.</p></li>
<li><p><strong>all_variables</strong> (<em>bool</em>) – Whether to load all variables from analysis.sqlite database, defaults to False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>SQLite filename.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.open_storage">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">open_storage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raw_calibration</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.open_storage" title="Link to this definition">¶</a></dt>
<dd><p>Open BAF dataset and return a non-zero instance handle to be passed to subsequent API calls.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to Bruker .d directory containing analysis.baf and analysis.sqlite.</p></li>
<li><p><strong>raw_calibration</strong> (<em>bool</em>) – Whether to use recalibrated data (False) or not (True), defaults to False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Non-zero instance handle.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.read_double">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">read_double</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">identity</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.read_double" title="Link to this definition">¶</a></dt>
<dd><p>Read array into a user provided buffer. The data will be converted to the requested type on the fly. The provided
buffer must be large enough to hold the entire array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for BAF dataset initialized using pyBaf2Sql.baf.open_storage().</p></li>
<li><p><strong>identity</strong> (<em>str</em><em> | </em><em>int</em>) – ID of the desired array.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Double array from the specified ID.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.read_float">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">read_float</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">identity</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.read_float" title="Link to this definition">¶</a></dt>
<dd><p>Read array into a user provided buffer. The data will be converted to the requested type on the fly. The provided
buffer must be large enough to hold the entire array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for BAF dataset initialized using pyBaf2Sql.baf.open_storage().</p></li>
<li><p><strong>identity</strong> (<em>str</em><em> | </em><em>int</em>) – ID of the desired array.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Float array from the specified ID.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.read_uint32">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">read_uint32</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">identity</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.read_uint32" title="Link to this definition">¶</a></dt>
<dd><p>Read array into a user provided buffer. The data will be converted to the requested type on the fly. The provided
buffer must be large enough to hold the entire array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>handle</strong> (<em>int</em>) – Handle value for BAF dataset initialized using pyBaf2Sql.baf.open_storage().</p></li>
<li><p><strong>identity</strong> (<em>str</em><em> | </em><em>int</em>) – ID of the desired array.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>uint32 array from the specified ID.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>numpy.array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.baf.set_num_threads">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.baf.</span></span><span class="sig-name descname"><span class="pre">set_num_threads</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_threads</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.baf.set_num_threads" title="Link to this definition">¶</a></dt>
<dd><p>Set the number of threads that this DLL is allowed to use internally. The index &lt;-&gt; m/z transformation is
internally parallelized using OpenMP. This call is simply forwarded to omp_set_num_threads(). This function has no
real effect on Linux.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>num_threads</strong> (<em>int</em>) – Number of threads to use (&gt;= 1)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyBaf2Sql.classes">
<span id="pybaf2sql-classes-module"></span><h2>pyBaf2Sql.classes module<a class="headerlink" href="#module-pyBaf2Sql.classes" title="Link to this heading">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="pyBaf2Sql.classes.BafData">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.classes.</span></span><span class="sig-name descname"><span class="pre">BafData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bruker_d_folder_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raw_calibration</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">all_variables</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sql_chunksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.classes.BafData" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class containing metadata from BAF files and methods from Baf2Sql library to work with BAF format data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bruker_d_folder_name</strong> (<em>str</em>) – Path to Bruker .d directory containing analysis.baf and analysis.sqlite.</p></li>
<li><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Library initialized by pyBaf2Sql.init_baf2sql.init_baf2sql_api().</p></li>
<li><p><strong>raw_calibration</strong> (<em>bool</em>) – Whether to use recalibrated data (False) or not (True), defaults to False.</p></li>
<li><p><strong>all_variables</strong> (<em>bool</em>) – Whether to load all variables from analysis.sqlite database, defaults to False.</p></li>
<li><p><strong>sql_chunksize</strong> (<em>int</em>) – Number of rows to read from SQL database query at once when reading tables/views from
analysis.sqlite.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pyBaf2Sql.classes.BafData.close_sql_connection">
<span class="sig-name descname"><span class="pre">close_sql_connection</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.classes.BafData.close_sql_connection" title="Link to this definition">¶</a></dt>
<dd><p>Close the connection to analysis.sqlite.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pyBaf2Sql.classes.BafData.get_db_tables">
<span class="sig-name descname"><span class="pre">get_db_tables</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sql_chunksize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1000</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.classes.BafData.get_db_tables" title="Link to this definition">¶</a></dt>
<dd><p>Get a dictionary of all tables found in the analysis.sqlite SQLite database in which the table names act as
keys and the tables as a pandas.DataFrame of values; this is stored in pyBaf2Sql.classes.BafData.analysis.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>sql_chunksize</strong> (<em>int</em>) – Number of rows to read from SQL database query at once when reading tables/views from
analysis.sqlite.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pyBaf2Sql.classes.BafSpectrum">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.classes.</span></span><span class="sig-name descname"><span class="pre">BafSpectrum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf_data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">profile_bins</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mz_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intensity_encoding</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">64</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.classes.BafSpectrum" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class for parsing and storing spectrum metadata and data arrays from BAF format data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>baf_data</strong> (<a class="reference internal" href="#pyBaf2Sql.classes.BafData" title="pyBaf2Sql.classes.BafData"><em>pyBaf2Sql.classes.BafData</em></a>) – BafData object containing metadata from analysis.sqlite database.</p></li>
<li><p><strong>frame</strong> (<em>int</em>) – ID of the frame of interest.</p></li>
<li><p><strong>mode</strong> (<em>str</em>) – Data array mode, either “profile”, “centroid”, or “raw”.</p></li>
<li><p><strong>profile_bins</strong> (<em>int</em>) – Number of bins to bin spectrum to.</p></li>
<li><p><strong>mz_encoding</strong> (<em>int</em>) – m/z encoding command line parameter, either “64” or “32”.</p></li>
<li><p><strong>intensity_encoding</strong> (<em>int</em>) – Intensity encoding command line parameter, either “64” or “32”.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pyBaf2Sql.classes.BafSpectrum.get_baf_data">
<span class="sig-name descname"><span class="pre">get_baf_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.classes.BafSpectrum.get_baf_data" title="Link to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="module-pyBaf2Sql.error">
<span id="pybaf2sql-error-module"></span><h2>pyBaf2Sql.error module<a class="headerlink" href="#module-pyBaf2Sql.error" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.error.throw_last_baf2sql_error">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.error.</span></span><span class="sig-name descname"><span class="pre">throw_last_baf2sql_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">baf2sql</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.error.throw_last_baf2sql_error" title="Link to this definition">¶</a></dt>
<dd><p>Error handling for Bruker raw data originating from BAF files. Modified from baf2sql.py example API.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>baf2sql</strong> (<em>ctypes.CDLL</em>) – Handle for Baf2sql library.</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyBaf2Sql.init_baf2sql">
<span id="pybaf2sql-init-baf2sql-module"></span><h2>pyBaf2Sql.init_baf2sql module<a class="headerlink" href="#module-pyBaf2Sql.init_baf2sql" title="Link to this heading">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="pyBaf2Sql.init_baf2sql.init_baf2sql_api">
<span class="sig-prename descclassname"><span class="pre">pyBaf2Sql.init_baf2sql.</span></span><span class="sig-name descname"><span class="pre">init_baf2sql_api</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bruker_api_file_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pyBaf2Sql.init_baf2sql.init_baf2sql_api" title="Link to this definition">¶</a></dt>
<dd><p>Initialize functions from Bruker’s Baf2Sql library using ctypes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>bruker_api_file_name</strong> (<em>str</em>) – Path to Baf2Sql library, defaults to packaged library paths if no custom paths are
provided.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Handle for Baf2Sql library.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>ctypes.CDLL</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pyBaf2Sql">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pyBaf2Sql" title="Link to this heading">¶</a></h2>
</section>
</section>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">pyBaf2Sql</a></h1>









<search id="searchbox" style="display: none" role="search">
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script><h3>Navigation</h3>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &#169;2024, Gordon T. Luu.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.0.2</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 1.0.0</a>
      
      |
      <a href="_sources/pyBaf2Sql.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>